 /***************************************************************************
 *   Copyright (C) 2010 by ZhangShine , All Rights Reserved                                  
 *   zhangshine0125@gmail.com                                              
 *                                                                         
 *   This program is free software; you can redistribute it and/or modify  
 *   it under the terms of the GNU General Public License as published by  
 *   the Free Software Foundation; either version 2 of the License, or     
 *   (at your option) any later version.                                   
 *                                                                         
 *   This program is distributed in the hope that it will be useful,       
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         
 *   GNU General Public License for more details.                          
 *                                                                         
 *   You should have received a copy of the GNU General Public License     
 *   along with this program; if not, write to the                         
 *   Free Software Foundation, Inc.,                                       
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             
 ***************************************************************************/

#ifndef NOTIFER_H
#define NOTIFER_H

#include <QWidget>
#include <QtCore>
#include "http.h"
#include "QLisaGlobal.h"

namespace Ui {
    class Notifer;
}

/*! \class Notifer
 * \brief 消息提醒
 *
 * 英语拼写错了
 */
class Notifer : public QWidget
{
    Q_OBJECT

public:
    explicit Notifer(QWidget *parent = 0);
    ~Notifer();
    void setNotiferContentAndShow(QList<QLisa::NotifyObject> messageList );
    void setNotiferContentAndShow(QString msg);
    void showIt();
    bool eventFilter(QObject *target, QEvent *event);
    void fadeOut();
    void setText();
    void setText(QString msg);
    
    
public slots:
    void PreButtonClicked();
    void NextButtonClicked();
    void ExitButtonClicked();
    void timeOutDeal();
    
private:
    void downloadPixmap();
    
private:
    Ui::Notifer *ui;
    QTimer *timer;//定时器，用来实现渐隐
    Http *http;//用来进行网络操作
    double timePassby;
    int currentMessageNumber;//当前信息编号
    QList<QLisa::NotifyObject> mList;//提醒消息列表
    QMap<QString, QPixmap> urlPixmapMap;//根据url存储图片
};

#endif // NOTIFER_H
